#pragma once

#include <map>
#include <string>
#include "GameObject.h"
#include "HeatPhysics.h"
#include "../SGD Wrappers/SGD_Math.h"

class PoolTile : public GameObject, public HeatPhysics
{
public:

	struct SlidingObject
	{
		GameObject* object;
		tVector2D current;
		tVector2D previous;
		float delta;
		bool gotDelta;
		int collided;
		bool wasMoved;
	};

private:

	static int iceCount;
	static int iceCounter;

	bool isFrozen;
	float *poolHeat;

	float slideSpeed;

	static vector<SlidingObject> slidingObjects;

public:

	//////////////////////////////////////////////////
	// 'Structor(s):
	PoolTile(string tag);
	~PoolTile(void);
	//************************************************

	//////////////////////////////////////////////////
	// GameObject Methods:
	void Update(float deltaTime)									override;
	void Render(void) const											override;
	void HandleCollision(GameObject& other, CollisionInfo& info)	override;
	void ResetToCheckPoint()										override;
	void SetCheckPointData()										override;
	//************************************************

	//////////////////////////////////////////////////
	// HeatPhysics Methods:
	void ApplyHeat(float amount)									override;
	//************************************************

	//////////////////////////////////////////////////
	// Accessors:
	inline bool IsFrozen(void) const { return isFrozen; }
	inline float GetPoolHeat(void) const { return *poolHeat; }
	//************************************************

	//////////////////////////////////////////////////
	// Mutators:
	//************************************************

};

class PoolSystem
{
private:

	static std::map<std::string, float> pools;

	/* Singleton
	PoolSystem(void);
	PoolSystem(const PoolSystem&);
	PoolSystem& operator=(const PoolSystem&);
	~PoolSystem(void);
	*/

public:

	static float* AddToPool(std::string tag);

};

